package 分类.一维动规;

public class 把数字翻译成字符串 {
    public static int solve (String nums) {
        // write code here
        String str=String.valueOf(nums);
        int[] dp=new int[str.length()];
        dp[0]=1;
        if(nums.charAt(nums.length()-1)=='0'){
            if(Integer.valueOf(nums)-26>0){
                return 0;
            }else {
                return 1;
            }
        }
        for (int i=1;i<dp.length;i++){
            dp[i]=dp[i-1];
            if(nums.charAt(i)=='0'){
                continue;
            }
            if(str.substring(i-1,i+1).compareTo("26")<=0&&str.substring(i-1,i+1).compareTo("10")>=0){

                if(i-2==-1){
                    dp[i]+=1;
                }else {
                    dp[i]+=dp[i-2];
                }

            }
        }
        return dp[dp.length-1];
    }

    public static void main(String[] args) {
         String num="160";
        System.out.println(solve(num));
    }
}
